package com.leo.spi;

import javax.servlet.ServletContext;
import javax.servlet.ServletRegistration;

/**
 * @ClassName: MyWebAppInitializerImpl
 * @Description: ${description}
 * @Author: leo825
 * @Date: 2020-05-17 22:41
 * @Version: 1.0
 */
public class MyWebApplicationInitializerTest implements MyWebAppInitializer{
    @Override
    public void loadOnStart(ServletContext servletContext){
        System.out.println("启动执行MyWebApplicationInitializerTest的loadOnStart方法");
        //注册一个为名字call的servlet
        ServletRegistration.Dynamic servletReg = servletContext.addServlet("call", CallServlet.class);
        servletReg.setLoadOnStartup(1);
        servletReg.addMapping("/call");
    }
}
